﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;

namespace Bussiness_Objects
{
    /// <summary>
    /// Class giu thong tin table THELOAI
    /// ----------------------------------------------------
    //  -- THELOAI(MaTheLoai, TenTheLoai)
    //  ----------------------------------------------------
    /// </summary>
    public class TheLoai : BusinessObjects
    {
        public TheLoai()
        {

        }

        public TheLoai(string tenTheLoai)
        {
            TenTheLoai = tenTheLoai;
        }

        public override void SetParameterInsert()
        {
            parms = new object[1];
            SqlParameter _parm = new SqlParameter(parTenTheLoai, TenTheLoai);
            parms[0] = _parm;
        }

        public override void SetParameterUpdate()
        {
            parms = new object[1];
            SqlParameter _parm = new SqlParameter(parTenTheLoai, TenTheLoai);
            parms[0] = _parm;

            _parm = new SqlParameter(parMaTheLoai, MaTheLoai);
            parms[1] = _parm;
        }

        public void SetParameterDelete()
        {
            parms = new object[1];
            SqlParameter _parm = new SqlParameter(parMaTheLoai, MaTheLoai);
            parms[0] = _parm;
        }

        public void SetParameterGetId()
        {
            parms = new object[1];
            SqlParameter _parm = new SqlParameter(parTenTheLoai, TenTheLoai);
            parms[0] = _parm;
        }

        public string TenTheLoai { get; set; }
        private const string parTenTheLoai = "@TenTheLoai";

        public int MaTheLoai { get; set; }
        private const string parMaTheLoai = "@MaTheLoai";
    }
}
